package yl.hs.bmipfull.controllers.salemanage;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yl.hs.bmipfull.controllers.ControllerBase;
import yl.hs.bmipfull.service.salemanage.IContractControlInfoService;
import yl.hs.bmipfull.viewmodels.PageQuery;
import yl.hs.bmipfull.viewmodels.WebResult;

/**
 * 作用:  销售合同发货控制信息控制层<br/>
 * 创建时间: 2021年05月19日 15时25分56秒 <br/>
 *
 * @author 张凯
 */
@Api(value = "销售合同发货控制信息Web接口", tags = "销售管理——销售合同发货控制信息操作")
@RequestMapping(value = "/api/contract/control")
@RestController
public class ContractControlInfoController extends ControllerBase {

    @Autowired
    IContractControlInfoService service;

    @ApiOperation(value = "查询销售合同发货控制信息", notes = "查询销售合同发货控制信息")
    @RequestMapping(value = "", method = RequestMethod.POST)
    public WebResult queryList(@ApiParam(value = "查询条件") @RequestBody PageQuery pageQuery) {
        try {
            return success("查询成功", service.queryList(pageQuery));
        } catch (Exception e) {
            return error(e);
        }
    }

    @ApiOperation(value = "查询销售合同发货控制信息", notes = "根据销售合同发货控制信息编号查询销售合同发货控制信息")
    @RequestMapping(value = "/{contractSn}", method = RequestMethod.GET)
    public WebResult findByContractSn(@ApiParam(value = "编号") @PathVariable String contractSn) {
        return success("查询成功", service.queryByContractSn(contractSn));
    }


}